# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=yate-bts
pkgver=6.1.0
pkgrel=1
pkgdesc='An open source GSM Base Station software.'
groups=('blackarch' 'blackarch-radio')
arch=('x86_64' 'aarch64')
url='https://yatebts.com/'
license=('GPL')
depends=('yate')
source=("http://yate.null.ro/tarballs/yatebts6/$pkgname-$pkgver-1.tar.gz"
        'gcc.patch')
sha512sums=('8401d34f255dde2864dd727cf6ec581b8aace6b7457940ed335d0eb62ce5775d62a127e92d440335dd214fce09e6cb90048130bb5c6133fd2b99fb7376332e95'
            'a86898114d4628fb012d92538d334c0de1e1bdd68de364c24bb1020535b622dee6b9757262fb7f1a6d6428bf23d8d3c9d71ce9ea4b3a0e95a278e79291b1c265')
backup=('etc/yate/snmp_data.conf'
        'etc/yate/ybts.conf'
        'etc/yate/tmsidata.conf'
        'etc/yate/subscribers.conf')
optdepends=('nginx: nipc_web support'
            'apache: nipc_web support'
            'php-fpm: nipc_web support')

prepare() {
  cd $pkgname

  patch -Np1 -i "$srcdir/gcc.patch"
}

build() {
  cd $pkgname

  ./configure --prefix=/usr \
              --sysconfdir=/etc
  make
}

package(){
  cd $pkgname

  make DESTDIR=$pkgdir install

  touch "$pkgdir/etc/yate/snmp_data.conf" "$pkgdir/etc/yate/tmsidata.conf"
}

